$(document).ready(function()
{
    $('.close').click(function(){
       $('#ajaxModal').remove();
        $('.modal-backdrop').remove();
    })
    $('.modal-ajax').css({"width":"540px"});

    $('#tijiao').click(function(){
        originalPassword = $('#originalPassword').val();
        password = $('#password').val();
        checkURL = createLink('user', 'changepassword');
        $.ajax(
            {
                contentType: 'application/x-www-form-urlencoded',
                type: "POST",
                data:"originalPassword=" + originalPassword + '&password=' + password,
                url:checkURL,
                dataType:'json',
                success:function(data)
                {
                     if (data.erro=='0'){
                         alert(data.data);
                     }else if (data.erro == '1'){
                         alert(data.data);
                         $('#ajaxModal').remove();
                         $('.modal-backdrop').remove();
                     }
                },
                error:function(data){alert('修改失败')}
            })

    })

})
